import request from '@/axios';

export const getList = (current, size, params) => {
    return request({
        url: '/api/blade-anwise/material/material/list',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const listSelect = (current, size, params) => {
    return request({
        url: '/api/blade-anwise/material/material/listSelect',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const listWithPurPrice = (current, size, params) => {
    return request({
        url: '/api/blade-anwise/material/material/listWithPurPrice',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const getNewList = (current, size, params) => {
    return request({
        url: '/api/blade-anwise/material/material/newList',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

export const findPageByModel = (current, size, params) => {
    return request({
        url: '/api/blade-anwise/material/material/findPageByModel',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}



export const getDetail = (id) => {
  return request({
    url: '/api/blade-anwise/material/material/detail',
    method: 'get',
    params: {
      id
    }
  })
}

export const remove = (ids) => {
  return request({
    url: '/api/blade-anwise/material/material/remove',
    method: 'post',
    params: {
      ids,
    }
  })
}

export const add = (row) => {
  return request({
    url: '/api/blade-anwise/material/material/submit',
    method: 'post',
    data: row
  })
}

export const update = (row) => {
  return request({
    url: '/api/blade-anwise/material/material/submit',
    method: 'post',
    data: row
  })
}

export const getMaterialFront = (id) => {
    return request({
        url: '/api/blade-anwise/material/material/getMaterialFront',
        method: 'get',
        params: {
            id: id
        }
    })
}

export const getMaterialByNo = (materialNo) => {
    return request({
        url: '/api/blade-anwise/material/material/getMaterialByNo',
        method: 'get',
        params: {
            materialNo: materialNo
        }
    })
}

export const auditMaterial = (materialNo) => {
    return request({
        url: '/api/blade-anwise/material/material/auditMaterial',
        method: 'get',
        params: {
            materialNo: materialNo
        }
    })
}

export const unAuditMaterial = (materialNo) => {
    return request({
        url: '/api/blade-anwise/material/material/unAuditMaterial',
        method: 'get',
        params: {
            materialNo: materialNo
        }
    })
}

export const selectAll = () => {
    return request({
        url: '/api/blade-anwise/material/material/selectAll',
        method: 'get'
    })
}

export const remoteList = (materialNo) => {
    return request({
        url: '/api/blade-anwise/material/material/remoteList',
        method: 'get',
        params: {
            materialNo: materialNo
        }
    })
}

export const remoteListByAll = (materialNo) => {
    return request({
        url: '/api/blade-anwise/material/material/remoteListByAll',
        method: 'get',
        params: {
            materialNo: materialNo
        }
    })
}


export const prodSearchReport = (id,isEnglish,hiddenBom) => {
    return request({
        url: '/api/blade-anwise/material/material/prodSearchReport',
        method: 'get',
        params: {
            id: id,
            isEnglish:isEnglish,
            hiddenBom:hiddenBom
        }
    })
}

export const selectSalesPricePage = (current, size, params) => {
    return request({
        url: '/api/blade-anwise/material/material/selectSalesPricePage',
        method: 'get',
        params: {
            ...params,
            current,
            size,
        }
    })
}

